<script type="text/html" template lay-done="layui.data.sendParams(d);">
    <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsOrderDistributionModel-editForm" id="LAY-app-CoreCmsOrderDistributionModel-editForm">
        <input type="hidden" name="id" value="{{d.params.data.model.id || '' }}" />
        <div class="layui-form-item">
            <label for="orderType" class="layui-form-label  layui-form-required">订单类型</label>
            <div class="layui-input-block">
                <select name="orderType" lay-verify="required|number" disabled="disabled">
                    <option value="">请选择类型</option>
                    {{# layui.each(d.params.data.orderTypes, function(index, item){ }}
                    <option value="{{ item.value }}" {{item.value===d.params.data.model.orderType?'selected="selected"':''}}>{{ item.description }}</option>
                    {{# }); }}
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label for="description" class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <input name="description" lay-verType="tips" class="layui-input" placeholder="请输入描述" lay-reqText="请输入描述" value="{{d.params.data.model.description || '' }}" />
            </div>
        </div>

        <div class="layui-form-item" pane>
            <label for="isOpenMailing" class="layui-form-label  layui-form-required">物流快递</label>
            <div class="layui-input-block">
                <input type="checkbox" lay-filter="switch" name="isOpenMailing" {{ d.params.data.model.isOpenMailing ? 'checked' : '' }} lay-skin="switch" lay-text="开启|关闭">
            </div>
        </div>

        <div class="layui-form-item" pane>
            <label for="isOpenHomeDelivery" class="layui-form-label  layui-form-required">同城配送</label>
            <div class="layui-input-block">
                <input type="checkbox" lay-filter="switch" name="isOpenHomeDelivery" {{ d.params.data.model.isOpenHomeDelivery ? 'checked' : '' }} lay-skin="switch" lay-text="开启|关闭">
            </div>
        </div>

        <div class="layui-form-item" pane>
            <label for="isOpenSelfDelivery" class="layui-form-label  layui-form-required">上门自提</label>
            <div class="layui-input-block">
                <input type="checkbox" lay-filter="switch" name="isOpenSelfDelivery" {{ d.params.data.model.isOpenSelfDelivery ? 'checked' : '' }} lay-skin="switch" lay-text="开启|关闭">
            </div>
        </div>

        <div class="layui-form-item text-right core-hidden">
            <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsOrderDistributionModel-editForm-submit" id="LAY-app-CoreCmsOrderDistributionModel-editForm-submit" value="确认编辑">
        </div>
    </div>
</script>
<script>
    var debug = layui.setter.debug;
    layui.data.sendParams = function (d) {
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d.params.data); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
            function () {
                var $ = layui.$
                    , form = layui.form
                    , admin = layui.admin
                    , laydate = layui.laydate
                    , upload = layui.upload
                    , cropperImg = layui.cropperImg
                    , coreHelper = layui.coreHelper;

                form.verify({

                    verifydescription: [/^.{0,255}$/, '描述最大只允许输入255位字符'],
                });
                //重载form
                form.render(null, 'LAY-app-CoreCmsOrderDistributionModel-editForm');
            })
    };
</script>
